package com.usian.controller;



import com.usian.feign.ContentFeign;
import com.usian.pojo.TbItemCat;
import com.usian.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("itemCategory")
public class ItemCategoryController {
    @Autowired
    private ContentFeign itemFeign;
    @RequestMapping("selectItemCategoryByParentId")
    public Result selectItemCategoryByParentId(@RequestParam(defaultValue = "0") Integer id){

                List<TbItemCat>list =itemFeign.selectItemCategoryByParentId(id);
                if (list!=null&&list.size()>1){
                    return Result.ok(list);
                }
                return Result.error("查询失败");
    }
}
